package com.sky.renren.library;

import android.graphics.Bitmap;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class RenrenWebViewClient extends WebViewClient {

	private WebInterface wInterface = null;
	
	public RenrenWebViewClient(WebInterface wInterface) {
		this.wInterface = wInterface;
	}
	
	public RenrenWebViewClient() {
		
	}
	@Override
	public void onPageStarted(WebView view, String url, Bitmap favicon) {
		super.onPageStarted(view, url, favicon);
	}

	@Override
	public void onPageFinished(WebView view, String url) {
		if (this.wInterface != null) {
			this.wInterface.onPageFinished();
			this.wInterface = null;
		}
	}

	@Override
	public void onReceivedError(WebView view, int errorCode,
			String description, String failingUrl) {
		super.onReceivedError(view, errorCode, description, failingUrl);
	}

	@Override
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		return super.shouldOverrideUrlLoading(view, url);
	}

}
